# Copyright 2023 Ant Group Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("//bazel:serving.bzl", "serving_cc_binary", "serving_cc_library", "serving_cc_test")

package(default_visibility = ["//visibility:public"])

serving_cc_library(
    name = "metrics_service",
    srcs = ["metrics_service.cc"],
    hdrs = ["metrics_service.h"],
    deps = [
        "//secretflow_serving/apis:metrics_cc_proto",
        "@brpc",
        "@brpc//:butil",
        "@prometheus-cpp//core",
        "@yacl//yacl/utils:elapsed_timer",
    ],
)

serving_cc_library(
    name = "default_metrics_registry",
    srcs = ["default_metrics_registry.cc"],
    hdrs = ["default_metrics_registry.h"],
    deps = [
        "@prometheus-cpp//core",
    ],
)

serving_cc_test(
    name = "metrics_service_test",
    srcs = ["metrics_service_test.cc"],
    deps = [
        ":default_metrics_registry",
        ":metrics_service",
    ],
)
